package StudyCode.summary.myfile;

import java.io.File;
import java.util.Date;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class FileModifyTime {
	public static void main(String[] args) {
		File file = new File("E:\\迅雷下载\\test1.txt");
		long modifiedTime = file.lastModified();
		System.out.println("最后修改时间是:" + new Date(modifiedTime));
		long newModifiedTime = System.currentTimeMillis();
		boolean success = file.setLastModified(newModifiedTime);
		if (success) {
			System.out.println("新的修改时间是:" + new Date(newModifiedTime));
		}
	}
}
